<template>
  <a-modal
    :visible="visible"
    title="推免预报名信息反馈"
    :width="1200"
    :bodyStyle="{
      'max-height': '76vh',
      overflow: 'auto'
    }"
    style="top: 20px;"
    okText="提交反馈"
    @cancel="() => { $emit('cancel') }"
    @ok="confirm"
  >
    <a-form :form="form">
      <a-form-item label="反馈内容">
        <a-textarea style="background: #fff;color: rgba(0,0,0,.65)" maxlength="2000" rows="4" :autosize="false" v-decorator="['yxlxksfkxx',{initialValue:'报名成功'}]" />
      </a-form-item>
    </a-form>
  </a-modal>

</template>

<script>
  import {mapState} from 'vuex'
  import moment from 'moment'

  export default {
    props: ['visible'],
    components: {},
    data() {
      return {
        form: this.$form.createForm(this)
      }
    },
    watch: {
      visible(val) {
        if (val) {
          this.form.resetFields()
        }
      }
    },
    computed: {
      ...mapState({})
    },
    created() {

    },
    methods: {
      getFormatTime(time) {
        return moment(time).format('YYYY-MM-DD')
      },
      confirm() {
        this.form.validateFields((err, values) => {
          if (err) {
            return
          }
          let params = Object.assign({}, values, {
            id: this.ids
          })
          this.$api.student.tmybmxxFeedback(params).then(res => {
            this.$message.success(res.msg)
            this.$emit('cancel')
            this.$emit('refresh')
          })
        });
      }
    }
  }
</script>

<style lang='less' scoped>
  .pre-red::before {
    display: inline-block;
    margin-right: 4px;
    content: "*";
    font-family: SimSun;
    line-height: 1;
    font-size: 14px;
    color: #f5222d;
  }
</style>
